import QtQuick
import QtQuick.Particles

Rectangle {
    id: useSoftwareWin
    width: 640
    height: 480
    clip: true
    visible: false
    color: mBackColor

    property color mBackColor: "#34393e"
    property color mTextColor: "#e1e4e8"

    CustomHeaderBarClose {
        id: headerBar
        x: 0
        y: 0
        width: parent.width
        height: 34
        chbTitleText: qsTr("使用说明")

        onClosePageBtnClicked: {
            parent.visible = false
        }
    }

    Column {
        anchors.centerIn: parent
        spacing: 5

        Repeater {
            model: ["1. 主页按下\"空格\"可播放和暂停灯效",
                "2. 主页按下\"CTRL+空格\"将灯珠居中显示",
                "3. 主页右键灯珠可单独设置颜色",
                "4. 主页滚轮可缩放查看灯效",
                "5. 左键可暂停或播放预览视频或帧图片",
                "6. 右键菜单在某些地方可查看更多选项"
            ]
            delegate: Text {
                width: 250
                text: modelData
                color: mTextColor
                font.pixelSize: 15
                font.italic: true
                horizontalAlignment: Text.AlignLeft
            }
        }
    }

    MouseArea {
        width: parent.width
        anchors.top: headerBar.bottom
        anchors.bottom: parent.bottom

        onPressed: {
            emitter.x = mouseX
            emitter.y = mouseY + headerBar.height - emitter.height
            emitter.enabled = true
        }

        onReleased: {
            emitter.enabled = false
        }

        onPositionChanged: function(mouse) {
            emitter.x = mouse.x
            emitter.y = mouse.y + headerBar.height - emitter.height
        }
    }

    ParticleSystem {
        id: particleSystem
    }

    ImageParticle {
        id: lovePainter
        source: "qrc:/imgs/love.png"
        system: particleSystem
    }

    Emitter {
        id: emitter
        x: 0
        y: 0
        width: 10
        height: 10
        system: particleSystem
        enabled: false
        emitRate: 20

        lifeSpan: 1000
        lifeSpanVariation: 400

        size: 14
        endSize: 24
        sizeVariation: 5
    }

}
